package com.tedu.day05mybatis.mapper;

import com.tedu.day05mybatis.pojo.Comment;
import com.tedu.day05mybatis.pojo.CommentVO1;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CommentMapper {
@Insert("INSERT INTO Comment(id,content,created,userId) VALUES (#{id},#(content),#(created),#(userId))")
    int insertComment (Comment comment);

@Delete("DELETE FROM Comment WHERE id=#(id)")
    int deleteByid (int  id);

@Update("UPDATE Comment SET (content=#(content),created=#(created),userId=(userId))")
    int updateId(Comment comment);

@Select("SELECT content,userid FROM Comment WHERE id=#{id}")
    CommentVO1 selectCommentById(int id);

}

